import axiosInstance from './axiosInstance';

const baseUrl = '/enterprise';

// 获取企业统计信息
export const getEnterpriseStats = () => {
  return axiosInstance.get(`${baseUrl}/stats`);
};

// 获取企业列表
export const getEnterpriseList = (params) => {
  return axiosInstance.get(`${baseUrl}/list`, { params });
};

// 新增企业
export const addEnterprise = (data) => {
  return axiosInstance.post(baseUrl, data);
};

// 更新企业
export const updateEnterprise = (id, data) => {
  return axiosInstance.put(`${baseUrl}/${id}`, data);
};

// 删除企业
export const deleteEnterprise = (id) => {
  return axiosInstance.delete(`${baseUrl}/${id}`);
};

// 获取企业详情
export const getEnterpriseDetail = (id) => {
  return axiosInstance.get(`${baseUrl}/${id}`);
};

// 审核企业
export const auditEnterprise = (id, params) => {
  return axiosInstance.put(`${baseUrl}/${id}/audit`, null, { params });
};